<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{commons :: top_head(~{::title})}">
    <title>首页</title>
</head>
<body>
<!--导航栏-->
<nav th:replace="~{commons :: top_nav_bar(1)}"></nav><!--中间内容-->
<!--中间内容-->
<div class="cus-padding-top-bottom-massive">
    <div class="ui container cus-container-width">
        <div class="ui stackable grid">
            <!--            左边的列表部分-->
            <div class="eleven wide column">
                <!--                标题-->
                <div class="ui top attached segment">
                    <div class="ui middle aligned two column grid">
                        <div class="column">
                            <div class="ui teal header">博客</div>
                        </div>
                        <div class="right aligned column">
                            共 <span class="ui header orange" th:text="${page.total}">0</span> 篇文章
                        </div>
                    </div>
                </div>
                <!--                列表-->
                <div class="ui attached segment">
                    <!--                    单篇文章-->
                    <div class="ui padded vertical segment cus-padding-medium cus-mobile-clear-left-right-padded"
                         th:each="blog : ${page.list}">
                        <div class="ui middle aligned grid mobile reversed stackable">
                            <div class="ui eleven wide column">
                                <h3 class="header"><a href="#" th:href="@{/blog/{id}(id=${blog.id})}"
                                                      th:text="${blog.title}">这是一个标题</a>
                                </h3>
                                <p class="cus-text-letter-space1" th:text="|${blog.description}.....|">
                                    描述
                                </p>
                                <div class="ui stackable grid">
                                    <div class="eleven wide column">
                                        <div class="ui horizontal link list">
                                            <div class="item left middle aligned">
                                                <img th:src="${blog.user.avatar}"
                                                     class="ui avatar mini image">
                                                <div class="content">
                                                    <a href="#" th:text="${blog.user.nickname}" class="header">用户名</a>
                                                </div>
                                            </div>
                                            <div class="item left middle aligned">
                                                <i class="iconfont icon-B5"></i><span
                                                    th:text="${#dates.format(blog.updateTime,'yyyy-MM-dd')}"></span>
                                            </div>
                                            <div class="item left middle aligned">
                                                <i class="iconfont icon-B5"></i><span
                                                    th:text="${blog.views}">1001</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="five wide column middle right aligned">
                                        <a href="#" th:text="${blog.type.name}"
                                           th:href="@{/types/{id}(id=${blog.type.id})}"
                                           class="ui label teal right floated">分类标签</a>
                                    </div>
                                </div>
                            </div>

                            <div class="ui five wide column">
                                <a href="#" alt="文章占位图链接" th:href="@{/blog/{id}(id=${blog.id})}">
                                    <img th:src="${blog.firstPicture}" alt="文章占位图"
                                         class="ui rounded image fluid">
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="ui bottom attached segment" th:if="${page.pages}>1">
                    <div class="ui middle aligned two column grid">
                        <a class="column" th:href="@{/{pageNum}(pageNum=${page.prePage})}"
                           th:if="${page.hasPreviousPage}">
                            <div class="ui teal basic button">上一页</div>
                        </a>
                        <a class="right aligned column" th:href="@{/{pageNum}(pageNum=${page.nextPage})}"
                           th:if="${page.hasNextPage}">
                            <div class="ui teal basic button">下一页</div>
                        </a>
                    </div>
                </div>
            </div>
            <!--            右边的列表部分-->
            <div class="five wide column">
                <!--                分类-->
                <div class="ui segments">
                    <ui class="ui segment two column grid">
                        <div class="ui column">
                            <div href="#">
                                <i class="iconfont icon-B"></i>
                                分类
                            </div>
                        </div>
                        <ui class="column right aligned">
                            <a href="#" target="_blank" th:href="@{/types}">more
                                <i class="iconfont icon-B"></i>
                            </a>
                        </ui>
                    </ui>
                    <div class="ui segment teal">
                        <div class="ui vertical menu fluid">
                            <a href="#" class="item" th:each="type:${types}"
                               th:href="@{/types/{id}(id=${type.id})}"><span
                                    th:text="${type.name}">学习笔记</span>
                                <div class="ui teal basic left pointing label" th:text="${type.size}">13</div>
                            </a>
                        </div>
                    </div>
                </div>
                <!--                标签-->
                <div class="ui segments">
                    <ui class="ui segment two column grid">
                        <div class="ui column">
                            <div href="#">
                                <i class="iconfont icon-B"></i>
                                标签
                            </div>
                        </div>
                        <ui class="column right aligned">
                            <a href="#" target="_blank" th:href="@{/tags}">more
                                <i class="iconfont icon-B"></i>
                            </a>
                        </ui>
                    </ui>
                    <div class="ui segment teal">
                        <div class="ui labels">
                            <a href="#" th:each="tag:${tags}" target="_blank" th:href="@{/tags/{id}(id=${tag.id})}"
                               class="ui teal left pointing label">
                                <span th:text="${tag.name}">方法论</span>
                                <span class="detail" th:text="${tag.size}">12</span>
                            </a>
                        </div>
                    </div>
                </div>
                <!--                最新文章推荐-->
                <div class="ui segments">
                    <div class="ui secondary segment">
                        <i class="iconfont icon-B"></i>最新推荐
                    </div>
                    <div class="ui segment" th:each="rBlog:${recentBlog}">
                        <a href="#" th:href="@{/blog/{id}(id=${rBlog.id})}" th:text="${rBlog.title}">推荐文章1</a>
                    </div>
                </div>
                <!--                二维码-->
                <div class="ui horizontal  divider header">扫码/关注/投喂/咨询</div>
                <div class="ui card centered">
                    <img th:src="@{/images/bird.gif}" class="ui rounded image" alt="一张占位符bird">
                </div>
            </div>
        </div>
    </div>
</div>
<!--底部内容-->
<footer th:replace="~{commons :: footer_nav_bar}"></footer>
</body>
</html>